package com.huaxin.feignclient.workOrder;

import com.huaxin.feignclient.models.ResponseResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Component
@FeignClient(name = "inspection-client", url = "${feignService.workorder:http://localhost:46833}")
public interface InspectionClient {
    @GetMapping("/v1/workorder/inspectionTemplateItemRel/existsByCabinetType")
    ResponseResult<Boolean> existsByCabinetType(@Parameter(description = "设备类型") @RequestParam(name = "cabinetType", required = true) String cabinetType);

    @Operation(summary = "查询每个配电房关联的巡检项数量", description = "查询每个配电房关联的巡检项数量")
    @GetMapping("/v1/workorder/inspectionOrder/countItemsByRoomIds")
    ResponseResult<List<Map<String, Object>>> countItemsByRoomIds(@Parameter(description = "配电房ID列表", name = "roomIds") @RequestParam(name = "roomIds", required = true) List<String> roomIds,
                                                                  @Parameter(description = "巡检单ID", name = "inspectionOrderId") @RequestParam(name = "inspectionOrderId", required = true) String inspectionOrderId);

    //根据客户id查询巡检工单数量
    @GetMapping("/v1/workorder/queryInspectionOrderCountByCustomerId")
    @Operation(summary = "根据客户id查询巡检工单数量", description = "根据客户id查询巡检工单数量")
    ResponseResult<Long> queryInspectionOrderCountByCustomerId(@RequestParam(name = "orgId", required = true) String orgId);
}
